package com.fgou.springcloud.service.dept;

import com.fgou.springcloud.mapper.DeptMapper;
import com.fgou.springcloud.pojo.Dept;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 查询部门
 * @author 99
 */
@Service("deptService")
public class DeptServiceImpl implements DeptService{

    @Resource(name = "deptMapper")
    DeptMapper deptMapper;

    @Override
    public boolean addDept(Dept dept) {
        return deptMapper.addDept(dept);
    }


    @Override
    @HystrixCommand()
    public Dept getDeptById(Long id) {
        return deptMapper.getDeptById(id);
    }

    @Override
    public List<Dept> getDeptAll() {
        return deptMapper.getDeptAll();
    }

}
